# Author:Haixin
# week07

# 列表的真正意义的复制  改变，打破

# 1. 假复制 用 = 进行赋值  错误的复制列表操作
# names = ["Mike","Mary","Jan","Jack"]
# names_源文件 = names
# names.append("Haixin")
# print("names = ",names)
# print("names_源文件 = ",names_源文件)

# 2. 正确的方法1.copy

# names = ["Mike","Mary","Jan","Jack"]
# names_源文件 = names.copy()
# names.append("Haixin")
# print("names = ",names)
# print("names_源文件 = ",names_源文件)

# 3. 正确的方法2. 切片[:]
names = ["Mike","Mary","Jan","Jack"]
names_源文件 = names[:]
names.append("Haixin")
print("names = ",names)
print("names_源文件 = ",names_源文件)
# 点看有什么方法再看填value还是index
